<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}再见爱人 - ByeLover{% endblock %}</title>
    <link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/fontawesome.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
    {% if request.endpoint and request.endpoint.startswith('admin.') %}
    <link rel="stylesheet" href="{{ url_for('static', filename='css/admin.css') }}">
    {% endif %}
    {% block styles %}{% endblock %}
</head>
<body>
    {% from 'macros.html' import render_comment %}
    
    <nav class="navbar">
        <div class="container">
            <a href="{{ url_for('main.index') }}" class="brand">👋 再见爱人</a>
            <div class="nav-links">
                <a href="/">首页</a>
                <a href="{{ url_for('main.couples_list') }}">所有爱人</a>
                {% if current_user.is_authenticated %}
                    {% if current_user.is_admin %}
                        <a href="{{ url_for('admin.index') }}">管理后台</a>
                    {% endif %}
                    <a href="{{ url_for('auth.logout') }}">退出 ({{ current_user.username }})</a>
                {% else %}
                    <a href="{{ url_for('auth.login') }}">登录</a>
                    <a href="{{ url_for('auth.register') }}">注册</a>
                {% endif %}
            </div>
            <div class="nav-search">
                <form action="{{ url_for('main.search') }}" method="get">
                    <input type="text" name="q" placeholder="搜索夫妻..." class="search-input">
                    <button type="submit" class="search-btn"><i class="fas fa-search"></i></button>
                </form>
            </div>
        </div>
    </nav>

    <div class="content-wrapper">
        {% block content %}{% endblock %}
    </div>

    {% include 'includes/footer.html' %}

    <script src="{{ url_for('static', filename='js/toast.js') }}"></script>
    <script src="{{ url_for('static', filename='js/main.js') }}"></script>
    {% block scripts %}{% endblock %}
</body>
</html> 